<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
    用户登录或注销公共部分
  Created by IntelliJ IDEA.
  User: Hengfei Li
  Date: 2021/2/17
  Time: 15:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div id="customer-info">
    <c:choose>
        <c:when test='${sessionScope.containsKey("customer")}'>
            您好，<c:out value="${sessionScope.customer.realName}"></c:out>
            <a href="${pageContext.request.contextPath }/customer-logout" style="color: white">注销</a>
        </c:when>
        <c:otherwise>
            <form action="${pageContext.request.contextPath }/customer-login-process" method="post" style="font-size: 12px;">
                用户名：<input name="username" type="text"> 密码：<input name="password" type="password">
                <button type="submit" style="font-size: 12px; padding: 3px 5px">登录</button>
				<a style="color: white" href="${pageContext.request.contextPath }/customer-register" target="_blank">新用户注册</a>
            </form> 
        </c:otherwise>
    </c:choose>
</div>